---
layout: "default"
title: "abs"
description: "Swift documentation for 'abs': Return the absolute value of x."
keywords: "abs,func,swift,documentation"
root: "/v1.2"
---

<div class="declaration" id="func-abs-t_-signednumbertype_-t">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-abs-t_-signednumbertype_-t">func <wbr>abs&lt;T : SignedNumberType&gt;(<wbr>_: T)</a>
        
<div class="comment collapse" id="comment-func-abs-t_-signednumbertype_-t"><div class="p">
    <p>Return the absolute value of <code>x</code>.</p>

<p>Concrete instances of <code>SignedNumberType</code> can specialize this
function by conforming to <code>AbsoluteValuable</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func abs&lt;T : SignedNumberType&gt;(x: T) -&gt; T</code>
    
    
</div></div>
</div>
